<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
    <title>ИС "Аттестация рабочих мест"</title>
    <link rel="stylesheet" type="text/css" href="/arm/resources/css/style.css">
</head>
<body>


<f:view>
    <a4j:form id="frm" ajaxSubmit="true">

        <%@ include file="/pages/common/menu.jsp" %>

        <h:panelGrid columns="3">

            <h:outputText id="normPerLbl" value="Наименование периода"/>
            <h:selectOneMenu id="per" value="#{dicNormiBean.dicNormi.dicPeriod}"  required="true"
                             converter="identifableConverter">
                <a4j:support event="onchange" reRender="per"/>
                <f:selectItems value="#{dicNormiBean.periodList}"/>
            </h:selectOneMenu>
            <rich:message for="per" styleClass="error" />

            <h:outputText id="normMetLbl" value="Вид измерения"/>
            <a4j:region>
                <h:selectOneMenu id="normMetSom" value="#{dicNormiBean.dicNormi.dicMetricType}"  required="true"
                                 converter="identifableConverter">
                    <a4j:support event="onchange" reRender="normCatSom"/>
                    <f:selectItems value="#{dicNormiBean.metricTypeList}"/>
                </h:selectOneMenu>
            </a4j:region>
            <rich:message for="normMetSom" styleClass="error" />

            <h:outputText id="normCatLbl" value="Категория"/>
            <h:selectOneMenu id="normCatSom" value="#{dicNormiBean.dicNormi.dicCategory}"  required="true"
                             converter="identifableConverter">
                <f:selectItems value="#{dicNormiBean.categoryList}"/>
            </h:selectOneMenu>
            <rich:message for="normCatSom" styleClass="error" />

            <h:outputText id="normMindimLbl" value="Минимальное измерение"/>
            <h:inputText id="normMindimTxt" value="#{dicNormiBean.dicNormi.mindim}" maxlength="8"/>
            <rich:message for="normMindimTxt" styleClass="error" />

            <h:outputText id="normMaxdimLbl" value="Максимальное измерение"/>
            <h:inputText id="normMaxdimTxt" value="#{dicNormiBean.dicNormi.maxdim}" maxlength="8"/>
            <rich:message for="normMaxdimTxt" styleClass="error" />

        </h:panelGrid>

        <h:panelGrid id="pnlButtonsRows" columns="2">
            <a4j:commandButton id="btnSave" action="#{dicNormiBean.save}" value="Сохранить"/>
            <a4j:commandButton id="btnCancel" action="#{dicNormiBean.cancel}" immediate="true" value="Отмена"/>
        </h:panelGrid>
    </a4j:form>
</f:view>
</body>
</html>